{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "bc0826e2-13d5-451c-8ff2-3f109aae2c2e",
   "metadata": {},
   "source": [
    "## 第一章 行列式"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "29fabe4b-92ee-4501-8498-f24a5da77c03",
   "metadata": {},
   "source": [
    "### 一、二阶与三阶行列式\n",
    "\n",
    "1. 二元线性方程组与二阶行列式\n",
    "二元线性方程组一般式如下：\n",
    "$$\n",
    "\\begin{cases}\n",
    "a_{11}x_{1}+a_{12}x_{2}=b_{1}\\\\\n",
    "a_{21}x_{1}+a_{22}x_{2}=b_{2}\n",
    "\\end{cases}\n",
    "$$\n",
    "二元线性方程组的4个系数组成：\n",
    "$\n",
    "\\left|\n",
    "\\begin{array}{cccc} \n",
    "    a_{11}  &  a_{12}  \\\\ \n",
    "    a_{21}  &  a_{22}  \n",
    "\\end{array}\n",
    "\\right| \n",
    "$\n",
    "的数表表达式式$a_{11}a_{12}－a_{21}a_{22}$称为二阶行列式。\n",
    "数$a_{ij}$称为行列式的元素或元。其第一个下标i称为行标，表明该元素位于第i行；第二个下标j称为列标，表明该元素位于第j列。位于第i行第j列的元素称为行列式的（i, j)元。\n",
    "上文二阶行列式的定义，可用对角线法则来记忆，如下图：\n",
    "\n",
    "![jupyter](./1.jpg)\n",
    "\n",
    "把$a_{11}$到$a_{22}$的实连线称为主对角线，$a_{12}$到$a_{21}$的虎连线称为副对角线，于是二阶行列式便是主对角线上的两元素之积减去副对角线上两元素之积所得的差。\n",
    "2. 三阶行列式\n",
    "** 定义1 ** 设有9个数排成3行3列的数表：\n",
    "$$\n",
    "\\begin{matrix}\n",
    "a_{11}  &  a_{12}  &  a_{13} \\\\\n",
    "a_{21}  &  a_{22}  &  a_{23}\\\\\n",
    "a_{31}  &  a_{32}  &  a_{33} \n",
    "\\end{matrix}\n",
    "$$\n",
    "记\n",
    "$\n",
    "\\left|\n",
    "\\begin{array}{cccc} \n",
    "a_{11}  &  a_{12}  &  a_{13} \\\\\n",
    "a_{21}  &  a_{22}  &  a_{23}\\\\\n",
    "a_{31}  &  a_{32}  &  a_{33} \n",
    "\\end{array}\n",
    "\\right| \n",
    "$ = $a_{11}a_{22}a_{33}+a_{12}a_{23}a_{31}+a_{13}a_{21}a_{32}-a_{11}a_{23}a_{32}-a_{12}a_{21}a_{33}-a_{13}a_{22}a_{31}$\n",
    "\n",
    "上述定义表明三阶行列式含6项,每项均为不同行不同列的三个元素的乘积再冠以正负号,其规律遵循图1.2所示的对角线法则:图中有三条实线看做是平行于主对角线的连线,三条虚线看做是平行于副对角线的连线,实线上三元素的乘积冠正号,虚线上三元素的乘积冠负号。\n",
    "\n",
    "![jupyter](./2.jpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c33df499-7f94-4c92-adb3-4ddb5416a490",
   "metadata": {},
   "source": [
    "### 二、全排列和对换\n",
    "3. 排列及其逆序数\n",
    "\n",
    "把n个不同的元素排成一列,叫做这n个元素的全排列(也简称排列)。\n",
    "n个不同元素的所有排列的种数,通常用$P_{n}$表示,可计算如下:\n",
    "从n个元素中任取一个放在第一个位置上,有n种取法;\n",
    "从剩下的n-1个元素中任取一个放在第二个位置上,有n-1种取法﹔\n",
    "这样继续下去,直到最后只剩下一个元素放在第n个位置上,只有Ⅰ种取法.于是\n",
    "$$ P_{n} = n ·（n-1)·...·3·2·1=n!.$$\n",
    "对于n个不同的元素,先规定各元素之间有一个标准次序(例如n个不同的自然数,可规定由小到大为标准次序),于是在这n个元素的任一排列中,当某一对元素的先后次序与标准次序不同时,就说它构成1个逆序.一个排列中所有逆序的总数叫做这个排列的逆序数.逆序数为奇数的排列叫做奇排列,逆序数为偶数的排列叫做偶排列\n",
    "下面来讨论计算排列的逆序数的方法.\n",
    "不失一般性,不妨设n个元素为1至n这n个自然数,并规定由小到大为标准次序.设$ P_{1}P_{2}...P_{n}$。为这n个自然数的一个排列,考虑元素$p_{i} (i= 1 ,2, ..., n ) $,如果比$p_{i}$大的且排在$p_{i}$前面的元素有个,就说$p_{i}$这个元素的逆序数是$t_{i}$,全体元素的逆序数之总和。\n",
    "\n",
    "4. 对换\n",
    "在排列中,将任意两个元素对调,其余的元素不动,这种作出新排列的手续叫做对换.将相邻两个元素对换.叫做相邻对换.\n",
    "\n",
    "**定理1一个排列中的任意两个元素对换,排列改变奇偶性.**\n",
    "\n",
    "**推论﹐奇排列对换成标准排列的对换次数为奇数,偶排列对换成标准排列的对换次数为偶数.**"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6d99072d-ca60-49a3-b894-b0114c00b93f",
   "metadata": {},
   "source": [
    "### 三、n阶行列式的定义\n",
    "\n",
    "** 定义2 ** 设有n^2个数，排成n行n列的数表**\n",
    "$$\n",
    "\\begin{matrix}\n",
    "a_{11}  &  a_{12}  &  ...  & a_{1n} \\\\\n",
    "a_{21}  &  a_{22}  &  ...  & a_{2n}\\\\\n",
    "............\\\\\n",
    "a_{31}  &  a_{32}  &    & a_{3n} \n",
    "\\end{matrix}\n",
    "$$\n",
    "作出表中位于不同行不同列的n个数的乘积，并冠以符号（－1）^t，得到形如\n",
    "$$ (-1)^{t}a_{1p_{1}}a_{1p_{1}}...a_{1p_{1}} $$\n",
    "的项，其中$ P_{1}P_{2}...P_{n}$为这n个自然数1，2，...，n的一个排列，t为这个排列的逆序数。由于这样的排列有n!个，因而上式的项有n!项，所有这些项的代数和：\n",
    "$$\\sum (-1)^{t}a_{1p_{1}}a_{1p_{1}}...a_{1p_{1}}$$称为n阶行列式，记作：\n",
    "$$\n",
    "D=\n",
    "\\begin{matrix}\n",
    "a_{11}  &  a_{12}  &  ...  & a_{1n} \\\\\n",
    "a_{21}  &  a_{22}  &  ...  & a_{2n}\\\\\n",
    "............\\\\\n",
    "a_{31}  &  a_{32}  &    & a_{3n} \n",
    "\\end{matrix}，\n",
    "$$\n",
    "简记作$det(a^{ij})$，其中数$a^{ij}$为行列式D的（i,j）元。\n",
    "主对角线以下(上)的元素都为0的行列式叫做上(下)三角形行列式;特别,主对角线以下和以上的元素都为0的行列式叫做对角行列式.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b3357ab0-b8c6-472b-8aff-8f10d1a226db",
   "metadata": {},
   "source": [
    "### 四、行列式的性质\n",
    "\n",
    "记\n",
    "$$D=\n",
    "\\left|\n",
    "\\begin{array}{cccc} \n",
    "a_{11}  &  a_{12}  &  ...  & a_{1n} \\\\\n",
    "a_{21}  &  a_{22}  &  ...  & a_{2n}\\\\\n",
    "............\\\\\n",
    "a_{31}  &  a_{32}  &    & a_{3n} \n",
    "\\end{array}\n",
    "\\right|，D^{T}=\n",
    "\\left|\n",
    "\\begin{array}{cccc} \n",
    "a_{11}  &  a_{12}  &  ...  & a_{1n} \\\\\n",
    "a_{21}  &  a_{22}  &  ...  & a_{2n}\\\\\n",
    "............\\\\\n",
    "a_{31}  &  a_{32}  &    & a_{3n} \n",
    "\\end{array}\n",
    "\\right|,\n",
    "$$\n",
    "行列式$D^T$称为行列式D的转置行列式。\n",
    "\n",
    "**性质1 行列式与它的转置行列式相等.**\n",
    "\n",
    "**性质2对换行列式的两行(列),行列式变号.**\n",
    "\n",
    "**推论如果行列式有两行(列)完全相同,则此行列式等于零.证把这两行对换,有D=-D,故D=0.**\n",
    "\n",
    "**性质3行列式的某一行(列}中所有的元素都乘同一数k,等于用数k乘此行列式.**\n",
    "第i行(或列)乘k ,记作$r_{i}×k（或c_{i}×k)$.\n",
    "\n",
    "**推论﹑行列式中某一行(列)的所有元素的公因子可以提到行列式记号的外面.**\n",
    "第i行(或列)提出公因子k ,记作$r_{i}÷k（或c_{i}÷k)$，有\n",
    "\n",
    "![jupyter](./3.jpg)\n",
    "\n",
    "**性质4 行列式中如果有两行(列)元素成比例,则此行列式等于零.**\n",
    "\n",
    "**性质5若行列式的某一行(列)的元素都是两数之和,例如第i行的元素都是两数之和:**\n",
    "\n",
    "$$D=\n",
    "\\left|\n",
    "\\begin{array}{cccc} \n",
    "a_{11}  &  a_{12}  &  ...  & a_{1n} \\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    "a_{i1}a^{'}_{i1}  &  a_{i2}a^{'}_{i2}  &  ...  & a_{in}a^{'}_{in}\\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    "a_{n1}  &  a_{n2}  &    & a_{nn} \n",
    "\\end{array}\n",
    "\\right|,\n",
    "$$\n",
    "则D等于下列两个行列式之和：\n",
    "$$D=\n",
    "\\left|\n",
    "\\begin{array}{cccc} \n",
    "a_{11}  &  a_{12}  &  ...  & a_{1n} \\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    "a_{i1}  &  a_{i2}  &  ...  & a_{in}\\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    "a_{n1}  &  a_{n2}  &    & a_{nn} \n",
    "\\end{array}\n",
    "\\right|+\n",
    "\\left|\n",
    "\\begin{array}{cccc} \n",
    "a_{11}  &  a_{12}  &  ...  & a_{1n} \\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    "a^{'}_{i1}  &  a^{'}_{i2}  &  ...  & a^{'}_{in}\\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    ". & . & .\\\\\n",
    "a_{n1}  &  a_{n2}  &    & a_{nn} \n",
    "\\end{array}\n",
    "\\right|\n",
    "$$\n",
    "\n",
    "**性质6 把行列式的某一行(列)的各元素乘同一数然后加到另一-行(列)对应的元素上去,行列式不变.**\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bdb9c7a3-b042-445d-8d48-c51630dbd945",
   "metadata": {},
   "source": [
    "### 五、行列式按行（列）展开\n",
    "\n",
    "在n阶行列式中,把(i,j)元$a_{ij}$所在的第i行和第j列划去后,留下来的n-1阶行列式叫做(i,j)元$a_{ij}$的余子式,记作$M_{ij}$;记\n",
    "$$ A_{ij}= (-1)^{i+j}M_{ij}，$$\n",
    "$A_{ij}$叫做(i,j)元$a_{ij}$的代数余子式。\n",
    "\n",
    "**引理一个n阶行列式,如果其中第i行所有元素除(i,j)元$a_{ij}$外都为零,那么这行列式等于$a_{ij}$与它的代数余子式的乘积,即**\n",
    "$$ D=a_{ij}A_{ij} $$\n",
    "\n",
    "\n",
    "**定理2行列式等于它的任一行(列)的各元素与其对应的代数余子式乘积之和,即**\n",
    "$$ D=a_{i1}A_{i1}+a_{i2}A_{i2}+...+a_{in}A_{in}  （i=1,2,...,n)$$\n",
    "**或**\n",
    "$$ D=a_{1j}A_{1j}+a_{2j}A_{2j}+...+a_{nj}A_{nj}  （j=1,2,...,n)$$\n",
    "\n",
    "这个定理叫做行列式按行(列)展开法则.利用这一法则并结合行列式的性质,可以简化行列式的计算.\n",
    "\n",
    "**推论行列式某一行(列)的元素与另一行(列)的对应元素的代数余子式乘积之和等于零.即**\n",
    "$$ D=a_{i1}A_{j1}+a_{i2}A_{j2}+...+a_{in}A_{jn}  （i≠j)$$\n",
    "**或**\n",
    "$$ D=a_{1i}A_{1j}+a_{2i}A_{2j}+...+a_{ni}A_{nj}  （i≠j)$$"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
